/*
 * @Description: 农业类型管理
 */
import zhreq from "@/api/axios";
export default {
  /**
   * @description: 获取所有数据项列表 *代表必填
   * @param {String/Number} page
   * @param {String/Number} size
   */
  getDataItemByList(params) {
    return zhreq.get(`v3/iot/iotPlatform/queryDataItemByCompanyMark?companyMark=${params}`)
  },

  /**
   * @description: 获取列表 *代表必填
   * @param {Object}  *
   */
  dataItemlist(params) {
    return zhreq.post('v3/iot/dataItem/queryPageList', {
      page: params.page,
      size: params.size,
      entity: params.entity
    });
    // return zhreq.post('v3/iot/dataItem/queryPageByCondition', params)
  },
  /**
   * @description: 通过单位名称条件查询所有单位
   * @param null *
   * @return {Object}
   */
  getPlantingUnitListByCondition(params) {
    return zhreq.post("/v3/templateTenant/unit/queryByCondition", {
      organizationNo: sessionStorage.organizationNo
    });
  },
  /**
   * @description: 查询气象站
   * @param null *
   * @return {Object}
   */
  getMeteorologicalByCondition(params) {
    return zhreq.get("v3/iot/iotPlatform/rtu/queryMeteorologicalRtuList", {
      organizationNo: sessionStorage.organizationNo
    });
  },
  /**
   * @description: 查询气象站
   * @param null *
   * @return {Object}
   */
  getRtuByCondition(params) {
    return zhreq.get(`v3/iot/iotPlatform/dataItem/queryByRtuId?rtuId=${params}`);
  },
  /**
   * @description: 批量拥有摄像头
   * @param {Object}  *
   */
  addFarmingTypelist(params) {
    return zhreq.post('v3/iot/dataItem/add', params);
    // return zhreq.post('/base/farmingType/add', params);
  },
  /**
  * @description: 批量拥有摄像头
  * @param {Object}  *
  */
  editFarmingTypelist(params) {
    return zhreq.post('v3/iot/dataItem/edit', params);
    // return zhreq.post('/base/farmingType/add', params);
  },
  /**
   * @description: 批量删除拥有摄像头
   * @param {Object}  *
   */
  delFarmingTypelist(params) {
    return zhreq.get(`v3/iot/dataItem/del?dataItemId=${params}&organizationNo=${sessionStorage.organizationNo}`);
  },
  /**
   * @description: 批量删除拥有摄像头
   * @param {Object}  *
   */
  delListFarmingTypelist(params) {
    return zhreq.post(`v3/iot/dataItem/delList`, params);
  },
  /**
   * @description: 通过农场id查询农场所拥有的农业类型
   * @param {Object}  *
   */
  queryCondFarmingTypelist() {
    return zhreq.post('v3/organization/base/farmingType/queryByCondition', {
      // "companyId": localStorage.companyId
      organizationNo: sessionStorage.organizationNo
    });
  }
};
